#ifndef SCENEWIDGET_H
#define SCENEWIDGET_H

#include <QTimer>

#include "adaptivewidgets.h"
#include "waitdialog.h"

class SceneWidget : public AGroupBox
{
    Q_OBJECT
public:
    explicit SceneWidget(QWidget *parent = nullptr);
    ~SceneWidget();
signals:
    void writeSceneName(uint8_t index, const QString &value);
    void loadScene(uint8_t index);
    void saveScene(uint8_t index);
    void exportScene(uint8_t index);
    void importScene(uint8_t index, const std::vector<uint8_t> &data);
public slots:
    void updateComboBox();
private:
    QString filePath(const QString &suffix);
private slots:
    void loadClicked();
    void saveClicked();
    void importClicked();
    void exportClicked();
    void importAllClicked();
    void exportAllClicked();
    void importAll();
    void exportAll();
    void exported(uint8_t cmd3, const std::vector<uint8_t> &data);
private:
    QMap<uint8_t, std::vector<uint8_t>> m_export;
    QMap<uint8_t, std::vector<uint8_t>> m_import;
    ALabel *nameLabel;
    ALineEdit *lineEdit;
    ALabel *currentLabel;
    AComboBox *comboBox;
    APushButton *loadButton;
    APushButton *saveButton;
    APushButton *importButton;
    APushButton *exportButton;
    APushButton *importAllButton;
    APushButton *exportAllButton;
    WaitDialog *waitDialog;
};

#endif // SCENEWIDGET_H
